import scrapy
from scrapy import Request
 
class TechlabpltSpider(scrapy.Spider):
    name = "techlabplt"
    allowed_domains = ["www.techlabplt.com"]
    start_urls = ["http://www.techlabplt.com"]
 
    def start_requests(self):
        if not self.start_urls and hasattr(self, "start_url"):
            raise AttributeError(
                "Crawling could not start: 'start_urls' not found "
                "or empty (but found 'start_url' attribute instead, "
                "did you miss an 's'?)"
            )
        for url in self.start_urls:
            yield Request(url, dont_filter=True)
 
    def parse(self, response):
        # request 请求的URL
        print('response.url：', response.url)
        # response对应的request对象
        print('response.request：', response.request)
        # response的状态码
        print('response.status：', response.status)
        # response的响应头
        print('response.headers：', response.headers)
        # response的响应体
        print('response.text：', response.text)
